package cn.com.biz;

import java.util.List;

import cn.com.dao.UserDao;
import cn.com.entity.User;

public class UserBiz {
	private User u;
	public User getU() {
		return u;
	}

	public void setU(User u) {
		this.u = u;
	}

	private UserDao userDao;
	
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public User login(User u){
		User user=userDao.login(u);
		return user;
	}

	public User zhuce(User u){
		userDao.zhuce(u);
		return u;
	}
	
	public boolean panduanUname(String uname){
		boolean b=false;
		List<String> unames=userDao.getUnames();
		for (int i=0; i<unames.size(); i++) {
			if(uname.equals(unames.get(i))){
				b=true;
				break;
			}
		}
		return b;
	}
	
}
